Skip to content

London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Implement and rewrite#1475

Open
B3-Bisrat wants to merge 3 commits into
CodeYourFuture:mainfrom
B3-Bisrat:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-May | Bisrat Tesfay | Sprint 3 | Implement and rewrite#1475
B3-Bisrat wants to merge 3 commits into
CodeYourFuture:mainfrom
B3-Bisrat:coursework/sprint-3-implement-and-rewrite

Conversation

@B3-Bisrat

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have done the implement and rewrite.

Questions

@B3-Bisrat B3-Bisrat added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026

@Luro91 Luro91 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.
There is one more error case that you can test in exercise 3.

I noticed that the assertions often have less test cases then the test files. I hope the comments in the test files helped you to think about good values for testing. In general you want to test all the edge case, borders and errors.

Comment on lines +19 to +39
if (angle <= 0 || angle >= 360) {
return "Invalid angle";
}

if (angle < 90) {
return "Acute angle";
}

if (angle === 90) {
return "Right angle";
}

if (angle < 180) {
return "Obtuse angle";
}

if (angle === 180) {
return "Straight angle";
}

return "Reflex angle";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done on the order of the logic. By putting the invalid values first it is easy to understand which values are valid. THen you go from smallest to biggest angle which makes it easy to follow

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Comment on lines +23 to +45
expect(getAngleType(91)).toEqual("Obtuse angle");
expect(getAngleType(120)).toEqual("Obtuse angle");
expect(getAngleType(179)).toEqual("Obtuse angle");
});

// Case 4: Straight angle
test(`should return "Straight angle" when angle is 180`, () => {
expect(getAngleType(180)).toEqual("Straight angle");
});

// Case 5: Reflex angles
test(`should return "Reflex angle" when (180 < angle < 360)`, () => {
expect(getAngleType(181)).toEqual("Reflex angle");
expect(getAngleType(270)).toEqual("Reflex angle");
expect(getAngleType(359)).toEqual("Reflex angle");
});

// Case 6: Invalid angles
test(`should return "Invalid angle" for invalid angles`, () => {
expect(getAngleType(0)).toEqual("Invalid angle");
expect(getAngleType(-10)).toEqual("Invalid angle");
expect(getAngleType(360)).toEqual("Invalid angle");
expect(getAngleType(400)).toEqual("Invalid angle");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. Good choices for the boundary cases

Comment on lines +27 to +32
test("should throw an error for invalid cards", () => {
expect(() => getCardValue("1♠")).toThrow();
expect(() => getCardValue("11♣")).toThrow();
expect(() => getCardValue("Z♥")).toThrow();
expect(() => getCardValue("invalid")).toThrow();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you think of another invalid value? (related to the number rank)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I hadn't considered 0 as an invalid number rank. I've added a test for "0♠".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if a number is passed without any suit?

@Luro91 Luro91 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 9, 2026
@B3-Bisrat B3-Bisrat added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 9, 2026
@Luro91 Luro91 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants